<template>
	<view class="container">
		<text class="topTitle">公共题库列表</text>
		<view class="reportView" @click="clickToList(i.id)"  v-for="(i, index) in publicList">
			<view class="titleView">
				<text>{{i.categoryName}}</text>
				<text class="orange">类目ID：{{i.id}}</text>
			</view>
			
			<view class="descView">
				<text>共{{i.subjectCount}}题 点击查看</text>
			</view>
		</view>
		
		<text class="topTitle">私人题库列表</text>
		<view class="reportView" @click="clickToList(i.id)"  v-for="(i, index) in privateList">
			<view class="titleView">
				<text>{{i.categoryName}}</text>
				<text class="orange">类目ID：{{i.id}}</text>
			</view>
			
			<view class="descView">
				<text>共{{i.subjectCount}}题 点击查看</text>
			</view>
		</view>
		
	</view>
		
</template>
<script>
	import { getAdminCate } from '@/api/exam/activity.js'
	export default{
		data(){
			return{
				publicList:[],
				privateList:[]
				 
			}
		},
		created() {
			this.getcate()
		},
		methods:{
			clickToList(e){
				this.$tab.navigateTo(`/pages/work/question/questionList?id=`+e)
			},
			getcate(){
				getAdminCate(this.pageForm).then(res=>{
					const list = res.data.list
					if(list.length > 0){
						for (let i = 0; i < list.length; i++) {
							if(list[i].parentId == 1){
								if(list[i].type == 1  ){
									this.publicList.push(list[i])
								}else{
									this.privateList.push(list[i])
								}
							}
							
						}
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	.container{
		background-color: #fff;
		height: 100vh;
		padding-top: 32rpx;
		.topTitle{
			padding-left: 40rpx;
			align-items: center;
			font-weight: bold;
			color: #000000;
		}
		.reportView{
			width: calc(100% - 80rpx);
			margin: 30rpx 40rpx;
			padding-top: 10rpx;
			font-size: 14px;
			font-family: Inter-Regular, Inter;
			font-weight: 400;
			color: #5E5E5E;
			display: flex;
			align-items: center;
			justify-content: space-between;
			line-height: 80rpx;
			border-bottom: 1px solid #F5EFEF;
			.titleView{
				text{
					padding-left: 20px;
				}
				.orange{
					color:  #FF9A50;
					font-size: 12px;
				}
			}
			.descView{
				text-align: right;
				padding-right: 20rpx;
				color: #508CFF;
			}
		}
	}
</style>